package com.week2.zuhe;

public class MyCircle 
{
	private MyPoint center;
	private int radius;
	
	public MyCircle()
	{
		
	}
	public MyCircle(int x,int y,int radius)
	{
		center = new MyPoint(x,y);
		this.radius = radius;
		
	}
	public MyCircle(MyPoint center,int radius)
	{
		this.center = center;
		this.radius = radius;
		
	}
	public MyPoint getCenter() {
		return center;
	}
	public void setCenter(MyPoint center) {
		this.center = center;
	}
	public int getRadius() {
		return radius;
	}
	public void setRadius(int radius) {
		this.radius = radius;
	}
	public int getCenterX()
	{
		return center.getX();
	}
	public void setCenterX(int x)
	{
		this.center.setX(x);
	}
	public int getCenterY()
	{
		return center.getY();
	}
	public void setCenterY(int y)
	{
		this.center.setY(y);
	}
	public int[] getCenterXY()
	{
		return center.getXY();
	}
	public void setCenterXY(int x,int y)
	{
		this.center = new MyPoint(center.getX(),center.getY());
	}
	public String toString()
	{
		return "MyCircle[radius="+radius+"center="+center.toString()+"]";
	}
	public double getArea()
	{
		return Math.PI*Math.pow(radius, 2);
	}
	public double getCircumference()
	{
		return Math.PI*radius*2;
	}
	public double distance(MyCircle another)
	{
		MyCircle mc = new MyCircle(center,radius);
		return mc.center.distance(center.getX(),center.getY());
	}

}
//这个构造函数public MyCircle(MyPoint center,int radius)，如果传入的center为null，就错了。
//setCenterXY  这个写错了。
//distance  这个也写错了。